#@author: liu Chanchan
#The code is my own work.
import sys

#Asks users to enter an integer grade in the range 0 to 100
try:
    integer_grade = int(input("Please input your integer grade(0-100)."))
except ValueError:
    sys.exit("Error: Grade must be an integer between 0 and 100")

# Check if the grade is within the valid range
if not (0 <= integer_grade <= 100):
    sys.exit("Error: Grade must be an integer between 0 and 100")

#Converts that grade into a result of Pass, Fail or Distinction
if  integer_grade < 40:
    print(f"{integer_grade} is a Fail")
elif  integer_grade < 70:
    print(f"{integer_grade} is a Pass")
else:
    print(f"{integer_grade} is a Distinction")

